function [proteinGeneMatrix, rowIndexMatrix, colIndexMatrix] = load_gmt_to_matrix(gmtFilePath)
    % Define the path to your .gmt file
    gmtFilePath = 'c2.cp.v2023.2.Hs.symbols.gmt';

    fid = fopen(gmtFilePath, 'r');
    if fid == -1
        error('File cannot be opened');
    end

    % 初始化变量
    proteinNames = {};
    geneNames = {};
    proteinGeneMatrix = [];
    rowIndexMatrix = {}; % 使用cell数组来存储蛋白质名称
    colIndexMatrix = {}; % 使用cell数组来存储基因名称
    row=1;
    % 逐行读取文件
    while ~feof(fid)
    
        % 读取单行
        tline = fgetl(fid);
   
        % 使用tab键分割行
        lineParts = strsplit(tline, '\t');
        
        % 第一列为蛋白质名称
        proteinName = lineParts{1};
        rowIndexMatrix{end+1} = proteinName; % 添加蛋白质名称到cell数组
          
        % 第三列及以后为基因名称
        geneNamesCurLine = lineParts(3:end);
        
        % 存储当前行的基因名称
        geneNamesCurLine = geneNamesCurLine(~cellfun('isempty', geneNamesCurLine)); % 移除空字符串
        for j = 1:length(geneNamesCurLine)
            if ~ismember(geneNamesCurLine{j}, geneNames)
                geneNames{end+1} = geneNamesCurLine{j}; % 添加基因名称到cell数组
            end
        end
        
        % 初始化当前行的基因交互矩阵
        interactionRow = false(1, length(geneNames));
        
        % 更新基因交互矩阵
        for j = 1:length(geneNamesCurLine)
            geneName = geneNamesCurLine{j};
            geneIndex = find(strcmp(geneNames, geneName));
            if ~isempty(geneIndex)
                interactionRow(geneIndex) = true; % 设置交互矩阵对应位置为true
            end
        end
        
        % 将当前行的基因交互矩阵添加到proteinGeneMatrix中
        if isempty(proteinGeneMatrix)
            proteinGeneMatrix = interactionRow;
        else
            if size(proteinGeneMatrix,2)<size(interactionRow,2)
            numExtracols=size(interactionRow,2)-size(proteinGeneMatrix,2);
            extraCols=zeros(size(proteinGeneMatrix,1),numExtracols);
            proteinGeneMatrix=[proteinGeneMatrix,extraCols];
            end
            proteinGeneMatrix = [proteinGeneMatrix; interactionRow];
        end
        row=row+1;
    end

    % 关闭文件
    fclose(fid);

    % 将cell数组转换为字符串数组，以便创建索引矩阵
    rowIndexMatrix = cellstr(rowIndexMatrix);
    colIndexMatrix = cellstr(geneNames);
end